<form action="<?php echo $this->escape($this->element->getAction()) ?>"
      method="<?php echo $this->escape($this->element->getMethod()) ?>" 
      name="<?php echo $this->escape($this->element->getName()) ?>" 
      enctype="<?php echo $this->escape($this->element->getEnctype()) ?>" 
      
      class="form-horizontal">

	<div class="control-group">
	  <?php foreach($this->element as $element): ?>
		
			
       		<?php if($element->getName() != "submit"): ?>
       		<?php echo $this->formLabel($element->getName(),$this->translate($element->getLabel()),array('class' => 'control-label'));
       		foreach ($element->getMessages() as $msg):
       		$verif = $msg;
       		endforeach;
       		?>
       		<div class="controls">
       		
      		<?php
      		if(!empty($verif)):
      		echo '<div class="control-group error">';
      		endif;
      		
      		if($element->getName() != "image"):
	      		echo $this->{$element->helper}(
	                         $element->getName(),
	                         $element->getValue(),
	                         $element->getAttribs(),
	                         (method_exists($element,'getMultiOptions')) ? $element->getMultiOptions() : array()
	     		) ;
			else:
			?>
			<input id="image" type="file" name="image[]" multiple="">
			<?php 
			endif;
			?>
       		<?php 	
      				$formErrors = $this->getHelper('formErrors');
      				$formErrors	->setElementStart('- ')
      							->setElementSeparator('<br/>- ')
      							->setElementEnd('');
      		 
      		 if(!empty($verif)):
      		 echo '<a class="info" data-placement="right" rel="tooltip" href="#" data-original-title="';
     		 echo $this->formErrors($element->getMessages()); 
     		 echo '"><i class="icon-info-sign"></i></a>';
      		 endif;
      		 
      		 if(!empty($verif)):
      		 echo '</div>';
      		 endif;
      		 $verif = null;
      		 ?>
     		 </div>
      		<?php else:?>	
      		<div class="form-actions">
      		<?php echo $this->formSubmit($element->getName(),$this->translate($element->getLabel()),array('class' => 'btn btn-primary', 'test' => $element->getAttrib("test")));?>
      		<button class="btn" type="reset" ><?php echo $this->translate('Cancel'); ?></button>
      		</div>
     		<?php endif;?>
     		<br>
	  <?php endforeach; ?>
	  </div>
		

</form>
